﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BBPA.Admin.SYS.Buyer
{
    public partial class List : ListPage
    {
        BLL.V_Buyer bllList = new BLL.V_Buyer();
        BLL.Buyer bll = new BLL.Buyer();
        //
        BLL.PAUser bllUser = new BLL.PAUser();
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.show_info = false;
        }
        public override void buildSQL_Page_List_search()
        {
        }
        public override DataSet get_Page_DataSet(string sql_, string orderby_, int pageFrom_, int pageTo_) { return bllList.GetListByPage(sql_, orderby_, pageFrom_, pageTo_); }
        public override void del_Page_List(string inStr_)
        {
            foreach (string id in inStr_.Split(','))
            {
                int thisID = DataTypePlus.requestInt(id);
                Model.Buyer modelBuyer = bll.GetModel(thisID);
                int thisUserID = modelBuyer.UserID;
                bllUser.Delete(thisUserID);
                bll.Delete(thisID);
                //
                BLL.User_Operate_Log.Add(Security.GetCurrentUserID(), EnumHelper.TableName.Buyer, thisID, EnumHelper.OperateType.Delete, "");
                BLL.User_Operate_Log.Add(Security.GetCurrentUserID(), EnumHelper.TableName.PAUser, thisUserID, EnumHelper.OperateType.Delete, "");
            }
        }

    }
}